package com.tyqx.detectcputemperaturesendmessage;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.data.mongo.MongoDataAutoConfiguration;
import org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration;
import org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.transaction.annotation.EnableTransactionManagement;

@EnableScheduling
@ComponentScan(basePackages = {"com.tyqx.detectcputemperaturesendmessage.*"},basePackageClasses = {com.tyqx.detectcputemperaturesendmessage.SchedulerGpuSendMessage.class,com.tyqx.detectcputemperaturesendmessage.Constant.class,com.tyqx.detectcputemperaturesendmessage.SchedulerNetworkInterruptionAndSendMessage.class})
@SpringBootApplication(exclude = {HibernateJpaAutoConfiguration.class, MongoAutoConfiguration.class, MongoDataAutoConfiguration.class},scanBasePackages = "com.tyqx.detectcputemperaturesendmessage.controller")
@ServletComponentScan
@EnableTransactionManagement
@EnableAsync
public class DetectCpuTemperatureSendMessageApplication {

    private static final Logger logger = LoggerFactory.getLogger(DetectCpuTemperatureSendMessageApplication.class);


    public static void main(String[] args) {
        //直接获取
//        System.out.println("spring boot args:"+Arrays.toString(args));
//        if(args.length>4) {
////            Constant.ping_website1 = args[0];
////            Constant.ping_website2 = args[1];
////            Constant.ping_website3 = args[2];
////            Constant.temp_upper = Integer.parseInt(args[3]);
////            Constant.temp_lower = args[4];
//        }else{
//            logger.error("请传入足够的启动参数 依次分别为ping网址1>ping网址2>ping网址3>指定gpu温度过高提醒的数值>指定gpu温度过低提醒的数值");
//        }
        SpringApplication.run(DetectCpuTemperatureSendMessageApplication.class, args);
    }

}
